home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 25 / AACD 25.iso / AACD / Magazine / Online / QMail / source / hostname.c < prev    next >
Encoding:
C/C++ Source or Header  |  1997-04-15  |  318 b   |  18 lines

  1. #include "substdio.h"
  2. #include "subfd.h"
  3. #include "readwrite.h"
  4. #include "exit.h"
  5.  
  6. char host[256];
  7.  
  8. void main()
  9. {
  10.  host[0] = 0; /* sigh */
  11.  gethostname(host,sizeof(host));
  12.  host[sizeof(host) - 1] = 0;
  13.  substdio_puts(subfdoutsmall,host);
  14.  substdio_puts(subfdoutsmall,"\n");
  15.  substdio_flush(subfdoutsmall);
  16.  _exit(0);
  17. }
  18.